<?Lassoscript
// Last modified 11/30/09 by Eric Landmann

// FUNCTIONALITY
// Topic search form

// CHANGE NOTES
// 4/17/09
// Version 1.0
// 11/30/09
// Got admin working better.

// Debugging
// Var:'svDebug' = 'Y';

// Converting action_params
Var:'vError'=(Action_Param:'Error');
Var:'vSID'=(Action_Param:'SID');
Var:'vTID'=(Action_Param:'TID');
Var:'vTopic_Title'=(Action_Param:'Topic_Title');
Var:'vAllow'=(Action_Param:'Allow');

?><form action="setup_searchresults.lasso" method="post">
	<div align="center">
		<table width="491">
			<tr>
				<td colspan="2">
					<h2>Search for Topics</h2> 
<?Lassoscript
// Standard Error Table
If: (Var:'vError') != '';
	LI_ShowError3: -ErrNum=$vError, -Option=$vOption;
/If;
?>
				</td>
			</tr>
			<tr>
				<td width="150" bgcolor="[Var:'svSearchContentColor']" valign="middle">
					<div align="right"><strong>Forum</strong></div>
				</td>
<?Lassoscript
// Get list of Sections
Var:'vSQLSearchSections'='SELECT * FROM ' $svSectionsTable ' ORDER BY Section_Title';
Inline: $IV_SearchSections, -SQL=$vSQLSearchSections;
	'\t<td bgcolor="'($svPostContentColor)'">\n\t\t\t<select name="SID">\n';
	'\t\t<option value=""'; If: (Var:'vSID') == ''; ' selected'; /If; '>--- Show All---</option>\n';
	Records;
		'\t\t\t<option value="'(Field:'Section_ID') '"'; If: (Field:'Section_ID') == ($vSID); ' selected'; /If; '>'(Field:'Section_Title')'</option>\n';
	/Records;
	'\t\t</select>\n';
/Inline;
	?> 
				</td>
			</tr>
			<tr>
				<td width="150" bgcolor="[Var:'svSearchContentColor']" valign="middle">
					<div align="right"><strong>Topic</strong></div>
				</td>
<?Lassoscript
// Get list of Topics
/* Var:'vSQLSearchTopics'='SELECT * FROM ' $svTopicsTable ' ORDER BY Topic_Title';
Inline: $IV_SearchTopics, -Table=$svTopicsTable, -SQL=$vSQLSearchTopics;
	'\t<td bgcolor="'($svPostContentColor)'"><select name="TID">\n';
	'\t\t<option value=""'; If: (Var:'vTID') == ''; ' selected'; /If; '>--- Show All---</option>\n';
	Records;
		'\t\t\t<option value="'(Field:'Topic_ID') '"'; If: (Field:'Topic_ID') == ($vTID); ' selected'; /If; '>'(Field:'Topic_Title')'</option>\n';
	/Records;
	'\t\t</select>\n';
/Inline;
*/
?>
				<td bgcolor="[$svPostContentColor]">
					<input type="text" name="Topic_Title" value="[$vTopic_Title]" size="30">
				</td>
			</tr>
		<tr>
			<td width="150" bgcolor="[Var:'svSearchContentColor']" valign="middle">
				<div align="right"><strong>Allow</strong></div>
			</td>
			<td valign="middle" bgcolor="[Var:'svPostContentColor']">
				<select name="Allow"> 
					<option value="" [if: (var:'vAllow') == ''] selected[/If]></option>
					<option value="Y" [if: (var:'vAllow') == 'Y'] selected[/if]>Yes</option>
					<option value="N" [if: (var:'vAllow') == 'N'] selected[/if]>No</option>
					<option value="A" [if: (var:'vAllow') == 'A'] selected[/if]>Archive</option>
				</select> 
			</td>
		</tr>
			<tr>
				<td colspan="2" bgcolor="[Var:'svSearchContentColor']">
					<div align="center">
						<input type="hidden" name="New" value="Y">
						<input type="hidden" name="Datatype" value="Topic">
						<input type="submit" name="-Nothing" value="Search">
					</div>
				</td>
			</tr>
		</table>
	</div>
</form>
